﻿using System;
using System.Reflection;
using Dsl.Ped.Common.Helpers;

namespace Dsl.Ped.Common.Extensions
{
    /// <summary>
    /// Extension methods for the <see cref="Type"/> objects
    /// </summary>
    public static class TypeExtension
    {
        /// <summary>
        /// Gets the <see cref="Assembly"/> in which the <see cref="Type"/> is defined
        /// </summary>
        /// <param name="type"><see cref="Type"/> which assembly we are interested in</param>
        /// <returns><see cref="Assembly"/> in which the given <see cref="Type"/> is defined, Null if given <see cref="Type"/>
        /// is null</returns>
        public static Assembly GetAssembly(this Type type)
        {
            return TypeHelper.GetAssembly(type);
        }
    }
}
